/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vamprest;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author sav
 */
@Embeddable
public class MemberaddressPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "idmember")
    private int idmember;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idaddress")
    private int idaddress;

    public MemberaddressPK() {
    }

    public MemberaddressPK(int idmember, int idaddress) {
        this.idmember = idmember;
        this.idaddress = idaddress;
    }

    public int getIdmember() {
        return idmember;
    }

    public void setIdmember(int idmember) {
        this.idmember = idmember;
    }

    public int getIdaddress() {
        return idaddress;
    }

    public void setIdaddress(int idaddress) {
        this.idaddress = idaddress;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idmember;
        hash += (int) idaddress;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MemberaddressPK)) {
            return false;
        }
        MemberaddressPK other = (MemberaddressPK) object;
        if (this.idmember != other.idmember) {
            return false;
        }
        if (this.idaddress != other.idaddress) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "vamprest.MemberaddressPK[ idmember=" + idmember + ", idaddress=" + idaddress + " ]";
    }

}
